Actor SniperRifleSpread : Inventory
{
inventory.maxamount 6
}

Actor BulletsInBarell : Inventory{inventory.maxamount 1}
Actor ZoomX4A : Inventory {inventory.maxamount 1}
Actor ZoomX4B : Inventory {inventory.maxamount 1}

Actor ZoomX4 : Inventory {inventory.maxamount 1}
Actor ZoomX2 : Inventory {inventory.maxamount 1}
Actor ZoomX6 : Inventory {inventory.maxamount 1}

////--------------------------------------------------------------------------
//
// Sniper Rifle
//
////--------------------------------------------------------------------------

ACTOR SniperRifle : BrutalWeapon 
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 30
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	YScale 0.6
	XScale 0.8
	Weapon.SelectionOrder 5200
	Weapon.AmmoType1 "Clip2"
	Weapon.AmmoType2 "SniperRifleAmmo"
	Obituary "%o was decapitated by %k's Chthon's claws."
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.ForbiddenTo Corvus
	Inventory.Pickupmessage  "You got the ''Chthon'' a three-barrel Sniper Rifle!!! (Slot 8)"
	+WEAPON.WIMPY_WEAPON
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
    +WEAPON.NOAUTOFIRE
	+FORCEXYBILLBOARD
	+WEAPON.NO_AUTO_SWITCH
    Scale 0.8
	States
	{
	PickUp:
	TNT1 A 0 A_Playsound("PICKUPONELINER")
	TNT1 A 0
	Stop
	
	GoingToReady:
	TNT1 A 1
	Goto Ready
	
	Ready3:
	Ready:
        TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "GoingToReady")
        TNT1 AAAAAAAA 0
        TNT1 A 0 //A_JumpIfInventory("RifleAmmo",1,2)
        //Goto Reload
        TNT1 AAAA 0
		// This is placed here for now, should be moved if there is a replaying
		// idle animation for weapons
	ReadyLoop:
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_TakeInventory("SniperRifleSpread", 5)
		PSRG A 0 A_JumpIfInventory("IsPaladin",1,3)
		MSRG A 0 A_JumpIfInventory("IsSorcerer",1,2)
        SRFG A 0
		"####" A 2 A_WeaponReady
		
        Goto ReadyLoop
    Ready2:
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		
		SR2G A 1 A_WeaponReady
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)

		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		
	    Loop
		ZoomZoomX6:
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_ZoomFactor(6.0)
		SR2G A 1 A_WeaponReady
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)

		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		Loop
		ZoomZoomX4:
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_ZoomFactor(4.0)
		SR2G A 1 A_WeaponReady
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)

		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		Loop
		ZoomZoomX2:
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_ZoomFactor(2.0)
		SR2G A 1 A_WeaponReady
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)

		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
				
		Loop
	Deselect:
		TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_TakeInventory("ThermalScopeGiver", 1)
		TNT1 A 0 A_TakeInventory("PowerLightAmp", 1)
		
        TNT1 A 0 A_ZoomFactor(1.0)
		SRFJ ABC 1
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1
		Wait
		
	Select:
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
//		MARN A 0 ACS_ExecuteAlways(728, 0, 0, 0, 0)//Check if penetration is on.
		TNT1 A 0 A_Raise
	    Goto ReadyPlaceholder
		
	ReadyPlaceholder:
	SHSS A 0 
	TNT1 A 0 A_PlaySound("CLIPIN")
	SRFJ FEDCBA 1 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
	
    Fire:
        TNT1 A 0 A_JumpIfInventory("SniperRifleAmmo",3,2)
        Goto NoAmmo
        TNT1 AAAA 0
		//TNT1 A 0 A_JumpIfInventory("SniperRifleSpread", 5, "FireHighSpread")
		TNT1 A 0 A_GiveInventory("SniperRifleSpread", 1)
		//TNT1 A 0 A_Takeinventory("DoubleRifleAmmo",1)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        //TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		PSRF A 0 A_JumpIfInventory("IsPaladin",1,3)
		MSRF A 0 A_JumpIfInventory("IsSorcerer",1,2)
        SRFF A 0
		"####" A 1 BRIGHT A_AlertMonsters
        TNT1 A 0 A_PlaySound("SRFR2", 15)
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
		TNT1 A 0 BRIGHT A_FireBullets (0.0, 0.3, 3, 14, "HitPuff")
        SR2F A 0 BRIGHT A_FireCustomMissile("Tracer", 2, 0.0, -1, 0)
        SR2F A 0 BRIGHT A_FireCustomMissile("Tracer", 2, 0.2, -1, 0)
        SR2F A 0 BRIGHT A_FireCustomMissile("Tracer", 2, 0.4, -1, 0)
		TNT1 A 0 A_SetAngle(random(8, -8) + angle)
        //SRFF A 0 A_FireCustomMissile("Tracer", random(-1,1), 0, -1, -12, 0, random(-1,1))
		TNT1 A 0 A_JumpIfInventory("NoPenetration", 1, 2)
		SRFF A 0 A_FireCustomMissile("WallPenetrationHitscan", 0, 0, -1, 0, 0, 0)
		TNT1 A 0
        TNT1 A 0 A_SetPitch(-6.0 + pitch)
		//TNT1 A 0 ACS_Execute(373, 0, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		TNT1 A 0 A_Takeinventory("SniperRifleAmmo",1)
		TNT1 A 0 A_Takeinventory("SniperRifleAmmo",1)
		TNT1 A 0 A_Takeinventory("SniperRifleAmmo",1)
		PSRF A 0 A_JumpIfInventory("IsPaladin",1,3)
		MSRF A 0 A_JumpIfInventory("IsSorcerer",1,2)
        SRFF A 0
		"####" A 1 Offset(0,29)
		"####" A 0 A_SetPitch(+1.2 + pitch)
		"####" B 1 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-6)
		"####" C 1 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-6)
		"####" D 1 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-6)
        "####" A 0 A_SetPitch(+1.2 + pitch)
		//SRFG A 0 A_Refire
		PSRG A 0 A_JumpIfInventory("IsPaladin",1,3)
		MSRG A 0 A_JumpIfInventory("IsSorcerer",1,2)
        SRFG A 0
		"####" A 1 Offset(0,29)
		"####" A 1  A_PlaySound("SRBOLT")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_TakeInventory("SniperRifleSpread", 5)

		Goto ReadyLoop
		
/*	FireHighSpread:
        TNT1 A 0 A_JumpIfInventory("RifleAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("DoubleRifleAmmo",1)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_PlaySound("weapons/rifle")
        //TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SRFF A 1 BRIGHT A_AlertMonsters
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
		SRFF B 1 BRIGHT A_FireBullets (8, 8, 1, 9, "HitPuff")
        SRFF A 0 A_FireCustomMissile("Tracer", random(-4,4), 0, -1, -12, 0, random(-4,4))
		TNT1 A 0 A_JumpIfInventory("NoPenetration", 1, 2)
		SRFF A 0 A_FireCustomMissile("WallPenetrationHitscan", random(-3,3), 0, -1, 0, 0, random(-3,3))
		TNT1 A 0
        TNT1 A 0 A_SetPitch(-0.7 + pitch)
		//TNT1 A 0 ACS_Execute(373, 0, 0, 0, 0)
		//TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		TNT1 A 0 A_Takeinventory("RifleAmmo",1)
		TNT1 A 0 A_SetPitch(+0.4 + pitch)
		SRFF C 2 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-6)
        SRFG A 1 A_SetPitch(+0.3 + pitch)
		SRFG A 1 A_Refire
		SRFG A 4 A_WeaponReady(1)
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_TakeInventory("RifleSpread", 5)
		SRFG A 4 A_WeaponReady(1)
		Goto Ready+6	*/

      Fire2:
	    TNT1 A 0 A_JumpIfInventory("SniperRifleAmmo",3,2)
        Goto NoAmmo2
	    TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
  		TNT1 A 0 A_PlaySound("SRFR1", 15)
		//TNT1 A 0 A_JumpIfInventory("IsFiringAltFireOnFullAuto", 1, "Fire2FullAuto")
        TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SR2G A 0 A_AlertMonsters
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,5)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,0,45)
		SR2F A 1 BRIGHT A_FireBullets (0.0, 0.3, 3, 14, "HitPuff")
        SR2F A 0 BRIGHT A_FireCustomMissile("Tracer", 0, 0.0, -1, 0)
        SR2F A 0 BRIGHT A_FireCustomMissile("Tracer", 0, 0.2, -1, 0)
        SR2F A 0 BRIGHT A_FireCustomMissile("Tracer", 0, 0.5, -1, 0)
		TNT1 A 0 A_JumpIfInventory("NoPenetration", 1, 2)
		SRFF A 0 A_FireCustomMissile("WallPenetrationHitscan", 0, 0, -1, -12, 0, 0)
		TNT1 A 0
        //TNT1 A 0 ACS_Execute(373, 0, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_SetPitch(-2.2 + pitch)
		TNT1 A 0 A_Takeinventory("SniperRifleAmmo",1)
		TNT1 A 0 A_Takeinventory("SniperRifleAmmo",1)
		TNT1 A 0 A_Takeinventory("SniperRifleAmmo",1)
		SR2F B 2 
		TNT1 A 0 A_SetPitch(0.4 + pitch)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",1,0,8,0)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",1,0,8,0)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",1,0,8,0)
        SR2F C 2 //A_WeaponReady(1)
		TNT1 A 0 A_SetPitch(0.4 + pitch)
		//TNT1 A 0 A_GiveInventory("IsFiringAltFireOnFullAuto", 1)
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
		SR2G A 2 
		SR2G A 2 A_PlaySound("SRBOLT")
        //SR2F B 0 A_ReFire
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
		//TNT1 A 0 A_TakeInventory("IsFiringAltFireOnFullAuto", 1)
		//SR2G A  A_WeaponReady(1)
//        SR2G A 8 //A_WeaponReady(1)
		Goto Ready2
		
/*	Fire2FullAuto:
	    TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
        TNT1 A 0 A_PlaySound("weapons/rifle")
        //TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SR2G A 0 A_AlertMonsters
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,5)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,0,45)
		SR2F A 1 BRIGHT A_FireBullets (0.1, 0.1, -1, 9, "HitPuff")
        SR2F A 0 BRIGHT A_FireCustomMissile("Tracer", 0, 0, -1, 0)
        //TNT1 A 0 ACS_Execute(373, 0, 0, 0, 0)
		//TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_SetPitch(-0.3 + pitch)
		TNT1 A 0 A_Takeinventory("RifleAmmo",1)
		TNT1 A 0 A_SetAngle(0 + angle)
		SR2F B 2
		TNT1 A 0 A_SetPitch(+0.1 + pitch)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",1,0,8,0)
        SR2F C 1
		TNT1 A 0 A_SetPitch(+0.2 + pitch)
		SR2G A 1 A_WeaponReady(1)
		TNT1 A 0 A_Refire
        TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
        SR2F B 0
		TNT1 A 0 A_TakeInventory("IsFiringAltFireOnFullAuto", 1)
		SR2G A 7 A_WeaponReady(1)
		SR2G A 0
		Goto Ready2	*/

    AltFire:
		TNT1 A 0
		TNT1 A 0 A_SetCrosshair(41)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"ADSOff")
		TNT1 A 0 A_Giveinventory("Zoomed",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
		PSRZ A 0 A_JumpIfInventory("IsPaladin",1,3)
		MSRZ A 0 A_JumpIfInventory("IsSorcerer",1,2)
        SRFZ A 0
        "####" AB 2
		TNT1 A 0 A_GiveInventory("PowerLightAmp", 1)

		TNT1 A 0 A_JumpIfInventory("ZoomX6",1,"ZoomZoomX6")
		TNT1 A 0 A_JumpIfInventory("ZoomX4",1,"ZoomZoomX4")
		TNT1 A 0 A_JumpIfInventory("ZoomX2",1,"ZoomZoomX2")


		//TNT1 A 0 A_GiveInventory("ThermalScopeGiver", 1)
		Goto Ready2
	ADSOff:
		TNT1 A 0 A_Light0
		TNT1 A 0 A_TakeInventory("PowerLightAmp", 1)
		//TNT1 A 0 A_TakeInventory("ThermalScopeGiver", 1)
      	SR2G AAAAA 1 	//wait before infrared runs out
	    PSRZ B 0 A_JumpIfInventory("IsPaladin",1,3)
		MSRZ B 0 A_JumpIfInventory("IsSorcerer",1,2)
        SRFZ B 0
        "####" BA 2
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_SetCrosshair(0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
        Goto Ready+6
		
	ChangeZoom:
		SR2G A 1 
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("ZoomX6",1,"SetZoomX4")
		TNT1 A 0 A_JumpIfInventory("ZoomX4",1,"SetZoomX2")
		TNT1 A 0 A_JumpIfInventory("ZoomX2",1,"SetZoomX4")
	//	TNT1 A 0 A_JumpIfInventory("ZoomX4A",1,"SetZoomX2")//awful hack, I have to wash my hands... (Lord Lothar)
	//	TNT1 A 0 A_JumpIfInventory("ZoomX4B",1,"SetZoomX6")//awful hack, I have to wash my hands... (Lord Lothar)
//		goto ready2
		goto ready2
	SetZoomX6:
		SR2G A 1 
		TNT1 A 0 A_TakeInventory("ZoomX2",1)
		TNT1 A 0 A_TakeInventory("ZoomX4",1)
	    TNT1 A 0 A_ZoomFactor(6.0)
		TNT1 A 0 A_GiveInventory("ZoomX6",1)
		Goto Ready2
		
	SetZoomX4:
		SR2G A 1
		TNT1 A 0 A_GiveInventory("ZoomX4",1)
		TNT1 A 0 A_TakeInventory("ZoomX6",1)
		//TNT1 A 0 A_TakeInventory("ZoomX2",1)
	    TNT1 A 0 A_ZoomFactor(4.0)

		Goto Ready2

	SetZoomX2:
		SR2G A 1 
		TNT1 A 0 A_JumpIfInventory("ZoomX2",1,"SetZoomX6")
		TNT1 A 0 A_TakeInventory("ZoomX4",1)
		TNT1 A 0 A_TakeInventory("ZoomX6",1)
	    TNT1 A 0 A_ZoomFactor(2.0)
		TNT1 A 0 A_GiveInventory("ZoomX2",1)
		Goto Ready2
	
	
	NoAmmo:
	TNT1 A 0 A_JumpIfInventory("Zoomed",1,"NoAmmo2")
	TNT1 A 0 A_TakeInventory("ThermalScopeGiver", 1)
	SRFG A 1 A_PlaySound("weapons/empty")
	TNT1 A 0 A_Takeinventory("Zoomed",1)
    TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_Takeinventory("ADSmode",1)
	Goto Ready+14
	
	NoAmmo2:
//	TNT1 A 0 A_TakeInventory("ThermalScopeGiver", 1)
	SR2G A 1 A_PlaySound("weapons/empty")
//	TNT1 A 0 A_Takeinventory("Zoomed",1)
 //   TNT1 A 0 A_ZoomFactor(1.0)
//	TNT1 A 0 A_Takeinventory("ADSmode",1)
	Goto Ready2
	
	ZoomOut:
		//TNT1 A 0 A_TakeInventory("ThermalScopeGiver", 1)
       	SR2G AAAAAAA 1 //wait in scope before infrared runs out
		TNT1 A 0 A_Light0
		TNT1 A 0 A_TakeInventory("PowerLightAmp", 1)
	    SRFZ BA 2
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
	Goto Reload
    
	Reload:
		TNT1 A 0 A_JumpIfInventory("ADSmode",1,"ChangeZoom")
		
        TNT1 A 0 A_JumpIfInventory("Zoomed",1,"ZoomOut")
		SRFG A 2 A_WeaponReady
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Reloading",1)
//		TNT1 A 0 A_Takeinventory("ADSmode",1)
//		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_JumpIfInventory("SniperRifleAmmo",33,"ready")
        TNT1 A 0 A_JumpIfInventory("Clip2",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1) 
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0
		PSCR A 0 A_JumpIfInventory("IsPaladin",1,3)
		MSCR A 0 A_JumpIfInventory("IsSorcerer",1,2)
        SRFR A 0
		"####" ABCDE 1  A_JumpIfInventory("Kicking",1,"DoKick")
		"####" A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
        "####" F 1 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)
        "####" G 5
		"####" A 0 A_PlaySound("Reload")
		"####" HI 1
		SRFR JTTTTTTTTTTTT 1 
		SRFR UV 1
		PSCR A 0 A_JumpIfInventory("IsPaladin",1,3)
		MSCR A 0 A_JumpIfInventory("IsSorcerer",1,2)
        SRFR A 0
		"####" KLM 1
		"####" WWWWWWW 1
		PSCR A 0 A_JumpIfInventory("IsPaladin",1,"PallyInsertMag")
		MSCR A 0 A_JumpIfInventory("IsSorcerer",1,"SorcyInsertMag")
	Goto MarineInsertMag
		
	PallyInsertMag:
		PSCR FEDCBA 1
		PSCR A 2 A_JumpIfInventory("Kicking",1,"DoKick")
		Goto MagInserted
		
		
	SorcyInsertMag:
		MSCR FEDCBA 1
		MSCR A 2 A_JumpIfInventory("Kicking",1,"DoKick")
		Goto MagInserted
		
	MarineInsertMag:
		SRFR NNOPQR 1
		SRFR S 2 A_JumpIfInventory("Kicking",1,"DoKick")
		
	MagInserted:
			
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
//		TNT1 A 0 A_JumpIfInventory("SniperRifleAmmo",1,"InsertBullets2")//30+1 effect
		//TNT1 A 0 A_Takeinventory("BulletsInBarell",1)
		TNT1 A 0 A_JumpIfInventory("SniperRifleAmmo",1,"InsertBullets2")		//if no bullets, then skip 2 next lines
		//Goto InsertBullets
		//TNT1 A 0 A_GiveInventory("BulletsInBarell",1) 		//remember bullet in barell 
		//TNT1 A 0 A_Takeinventory("SniperRifleAmmo",33) 		//remove ALL bullets left 
		//Goto InsertBullets2

	
	InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("SniperRifleAmmo",30,"Ready")
		TNT1 A 0 A_JumpIfInventory("Clip2",1,3)
		Goto ReadyLoop
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("SniperRifleAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip2",1)
		Goto InsertBullets
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto ReadyLoop
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto ReadyLoop
		
/*	InsertBarellBullets:
		TNT1 AAAA 0
//		TNT1 A 0 A_JumpIfInventory("BulletsInBarell",0,"Ready")
		TNT1 A 0 A_Giveinventory("SniperRifleAmmo",3)		  //return bullets to barrell
		TNT1 A 0 A_Takeinventory("BulletsInBarell",1)  //forget about bullet
		Goto ReadyLoop */
		
	InsertBullets2:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("SniperRifleAmmo",33,"ReadyLoop")
		TNT1 A 0 A_JumpIfInventory("Clip2",1,3)
		Goto ReadyLoop
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("SniperRifleAmmo",1)
		//TNT1 A 0 A_Giveinventory("DoubleRifleAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip2",1)
		Goto InsertBullets2
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto ReadyLoop
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto ReadyLoop	
		
		
		
		
		
		
		
		
	Unload:
		SRFG A 2 A_WeaponReady
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_JumpIfInventory("SniperRifleAmmo",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		SRFR TSRQPO 2
        TNT1 A 0 A_PlaySound("Reload")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		
	RemoveBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("SniperRifleAmmo",1,3)
		Goto FinishUnload
        TNT1 AAAAAA 0
		TNT1 A 0 A_Takeinventory("SniperRifleAmmo",1)
		//TNT1 A 0 A_Takeinventory("DoubleRifleAmmo",1)
		TNT1 A 0 A_Giveinventory("Clip2",1)
		Goto RemoveBullets
	
	FInishUnload:
		SRFR NMLKIJGHGFEDCBA 2
		TNT1 A 0 A_PlaySound("DryFire")
		TNT1 A 0 A_GiveInventory("HasUnloaded", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		Goto ReadyLoop
				
 	Spawn:
		CHTO A -1
		Stop
	
	}
}

/*Actor Zoomed : Inventory
{
inventory.maxamount 1
}*/

//Actor RifleAmmo : Inventory
//{
//inventory.maxamount 30
//}

ACTOR SniperRifleAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 33
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 33
   Inventory.Icon "CHTOA0"
}

//ACTOR MeatshieldGunAmmo : Ammo
//{
//   Inventory.Amount 0
//   Inventory.MaxAmount 30
//   Ammo.BackpackAmount 0
//   Ammo.BackpackMaxAmount 30
//}

//ACTOR MeatAmmo : Ammo
//{
//   Inventory.Amount 0
//   Inventory.MaxAmount 100
//   Ammo.BackpackAmount 0
//   Ammo.BackpackMaxAmount 100
//}



//ACTOR FlashlightProjectile: FastProjectile
//{
//	Radius 32
//	Height 32
//	Speed 300
//	Damage 0
//	States
//	{
//	Spawn:
/*        TNT1 A 2
		Stop

    Death:
	XDeath:
	    TNT2 A 3
		Stop
	}
}


ACTOR FlashlightProjectile2: FlashlightProjectile
{
	Radius 22
	Height 2
}


ACTOR FlashlightProjectile3: FlashlightProjectile
{
	Radius 2
	Height 2
	Speed 600
}


ACTOR FlashlightSource: FlashlightProjectile
{
	Radius 2
	Height 2
	Speed 0
	States
	{
	Spawn:
	TNT1 A 2
	Stop
	Death:
	Xdeath:
	Stop
	}
}



Actor IsFlashlightOn : Inventory
{
inventory.maxamount 1
}


Actor FLashlightAction : Inventory
{
inventory.maxamount 1 
}*/